home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Makes a directory with TwinExpress from DOpus.
- *
- * (c) 1994 by K.P. van Beem (2:280/464.2, patrick.van.beem@aobh.xs4all.nl)
- *
- * Based on the DOpusLhaARexx package by Geoff Seeley (but you can better
- * use GuiArc in stead of DOpus and a script, to deal with archives)
- *
- - Bug Fix by Ray Abram
- - Will work in a Twin or a DOpus file list
- - Prompting tells if dir is to be local or remote
- */
-
- trace ?R
-
- DOpusPort = 'DOPUS.1'
-
- if ~show(l,"rexxsupport.library") then
- call addlib("rexxsupport.library",0,-30,0)
- if showlist('Ports', DOpusPort) = 0 then do
- say 'Directory Opus Arexx port not found. Aborting.'
- call CleanUp
- end
-
- address 'DOPUS.1'
- options results
-
- /* setup DOpus window and tell user what's happening */
- Busy on
- TopText "Creating (sub)directory..."
-
- /* Get the current path to create the dir */
- 'Status 6 -1'
- GetEntry Result
- FilePath = Result
- if left(FilePath,1) ~= '*' then do
- TopText "You are not in a Twin directory. ??"
- makedir
- call CleanUp
- end
-
- /* get the path from the string */
- FilePath = SubStr(FilePath,2)
- DA = EnterDir(FilePath)
-
- /* get more descriptive text */
- if DA = '~' then
- Question = '"Enter new Remote Directory Name..."'
- else
- Question = '"Enter new Local Directory Name..."'
-
- /* Get the name of the directory to create */
- getstring Question
- Directory = Result
- if Directory="" | rc~=0 then do
- TopText "Aborted or You have to give a Directory Name."
- call CleanUp
- end
-
- /* Check for spaces in the filename */
- if words(Directory) > 1 then do
- request "Spaces in a Directory name are not allowed !!"
- call CleanUp
- end
-
- DA = EnterDir(FilePath)
- address command 'echo >PPipe: MkDir' Quote(DA || Directory)
-
- 'DisplayDir -1'
- address command "rx Rexx:DOpus/Reread.rexx"
- call CleanUp
-
- exit
-
- /*---------------------------------------------------------------------------*/
-
- CleanUp: /* Remove any files and exit */
-
- Busy off
-
- exit
-
- return
-
- /*--------------------------------------------------------------------------*/
-
- Quote: procedure /* add quotes to string */
-
- parse arg string
-
- return '"'||string||'"'
-
- /*--------------------------------------------------------------------------*/
-
- /* Cd into the sent Directory path
- - this is needed, as TWIN has a command parameter limit of 30 characters,
- and as we all know AmigaDos file & paths can easily go over this limit !!*/
-
- EnterDir: procedure
-
- parse arg Dev ':' Path
-
- /* get the 1st character to address the local or remote machine correctly */
- if left(Dev,1) = '~' then
- sbit = '~'
- else
- sbit = ''
-
- /* does the passed name have a DEVICE in it ? */
- if Dev ~= '' then
- address command 'echo >PPipe: cd' Dev || ':'
-
- do until (t2 = '')
- parse var Path t1 '/' t2
- path = t2
- if t1 ~= '' then
- address command 'echo >PPipe: cd' sbit || t1
- end
-
- return sbit
-
-